<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>子类重载父类得方法</title>
</head>
<body>
	<?php
    class Person 
  {    protected $name;
       protected $age;
       protected $sex;

      function  __construct($name,$age,$sex){
      $this->name=$name;       
      $this->age=$age; 
      $this->sex=$sex; 
      }
  
       }
     function say(){
        echo "我名字是".$this->name."我年龄是".$this->age."我性别是".$this->sex."<br>";
   }
      function run(){
     }	
   /**
   	* 
   	*/
   	class Student extends Person
   	{
   		var $school;
   		function __construct($name,$age,$sex,$school)
   		{
   		parent::__construct($name,$age,$sex);
   		$this->school=$school;	
   		}
     function study(){
           echo $this->name."正在装逼".$this->school."装逼"."<br>";

     }
     function say(){
     	parent::say();
     	echo "我正在".$this->school."上学"."<br>";
     }
   	}	
     $stu1=new Student("zhangsan ",23,"male","东软");
     $stu1->say();



	?>


</body>
</html>